//
//  TopNewCell.m
//  NewsApp
//
//  Created by 曾凯峻 on 15/1/22.
//  Copyright (c) 2015年 zkj. All rights reserved.
//

#import "TopNewCell.h"

@implementation TopNewCell
- (void)dealloc
{
    [_titleLabel release];
    [_digestLabel release];
    [_ptimeLabel release];
    [_imgsrcImage release];
    [super dealloc];
}
//自定义cell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.titleLabel = [[UILabel alloc] init];
        _titleLabel.font = [UIFont boldSystemFontOfSize:16.0f];
       // _titleLabel.backgroundColor = [UIColor redColor];
        [self.contentView addSubview:_titleLabel];
        [_titleLabel release];
        
        self.digestLabel = [[UILabel alloc] init];
      //  _digestLabel.backgroundColor = [UIColor orangeColor];
        self.digestLabel.font = [UIFont boldSystemFontOfSize:14.0f];
        self.digestLabel.textColor = [UIColor grayColor];
        _digestLabel.numberOfLines = 2;
        [self.contentView addSubview:_digestLabel];
        [_digestLabel release];
        
        self.ptimeLabel = [[UILabel alloc] init];
        _ptimeLabel.font = [UIFont boldSystemFontOfSize:12.0f];
         self.ptimeLabel.textColor = [UIColor grayColor];
      //  _ptimeLabel.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_ptimeLabel];
        [_ptimeLabel release];
        
        self.imgsrcImage = [[UIImageView alloc] init];
       // _imgsrcImage.backgroundColor = [UIColor greenColor];
        [self.contentView addSubview:_imgsrcImage];
        [_imgsrcImage release];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];

    self.titleLabel.frame = CGRectMake(90, 0, self.contentView.frame.size.width - 90, 30);
    self.digestLabel.frame = CGRectMake(90, 20, self.contentView.frame.size.width - 100, 60);
    self.ptimeLabel.frame = CGRectMake(90, 70, 120, 10);
    self.imgsrcImage.frame = CGRectMake(5, 10, 80, 70);
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
